<%@ page contentType="text/html; charset=UTF-8" %>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@ page import="com.wlcorp.forcazamis.domain.storagein.StorageIn" %>
<%@ page import="com.wlcorp.forcazamis.domain.confirm.ConfirmDetail" %>
<%@ page import="com.wlcorp.forcazamis.sys.util.AppConstant" %>
<%@ page import="com.wlcorp.forcazamis.sys.permission.PermissionManager" %>
<%
	List storageInList = (List)request.getAttribute("storageInList");
%>
<html>
<head>
	<title>样品入库单列表</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Expires" content="0">
	<link href="${pageContext.request.contextPath}/css/css.css" rel=stylesheet>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/button_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/form_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/table_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/pagetitle_css.css" type="text/css">
	<script language="javascript" src="${pageContext.request.contextPath}/script/common.js"></script>
	<script type="text/javascript">
    	function storageInBaseInfo(storageInId){
    		window.parent.location = "${pageContext.request.contextPath}/storagein/storageInManager.do?method=getStorageIn&storageInId=" + storageInId;
    	}
    	function deleteRecord(storageInId){
    		if(confirm("确定删除？")){
    			window.location = "${pageContext.request.contextPath}/storagein/storageInManager.do?method=deleteStorageIn&storageInId=" + storageInId;
    		}
    	}
    	function storageDetail(storageInId){
			window.parent.location = "${pageContext.request.contextPath}/storagein/storageInManager.do?method=getStorageInDetail&storageInId=" + storageInId;
		}
		
		function printStorageIn(storageInId){
			window.open("${pageContext.request.contextPath}/storagein/storageInManager.do?method=printStorageIn&storageInId=" + storageInId);
		}
    </script>
</head>
<body bgcolor="#ffffff">
  <center>
	<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
          <tr bgcolor="#E7E7E7">
            <td class="bigtext" align="center" width="5%">序号</td>
            <td class="bigtext" align="center">仓库名称</td>
            <td class="bigtext" align="center">入库人</td>
            <td class="bigtext" align="center">类型</td>
            <td class="bigtext" align="center">时间</td>
            <td class="bigtext" align="center">审批时间</td>
            <td class="bigtext" align="center">状态</td>
            <td class="bigtext" align="center">操作</td>
          </tr>
          <% 
          	int index = 0;
          	for(Iterator iter = storageInList.iterator();iter.hasNext();){
          		StorageIn storageIn = (StorageIn)iter.next();
          		index++;
          %>
          <tr bgcolor="#ffffff" onmouseover="this.style.backgroundColor='#bbdffb';" onmouseout="this.style.backgroundColor='#ffffff'">
            <td align="center" class="td5px"><%=index%></td>
            <td class="td5px">样品库</td>
            <td class="td5px"><%=storageIn.getSubmiter().getStaffName()%></td>
            <td class="td5px"><%=storageIn.getTypeName()%></td>
            <td class="td5px"><%=storageIn.getInStorageDate()%></td>
            <td class="td5px"><%if(null != storageIn.getConfirm()){out.print(((ConfirmDetail)storageIn.getConfirm().getConfirmDetailSet().iterator().next()).getConfirmDate());}%></td>
            <td class="td5px"><%=storageIn.getStateName()%></td>
            <td align="center" class="td5px"><a href="javascript:printStorageIn('<%=storageIn.getStorageInId()%>')">打印</a>&nbsp;
            <a href="javascript:storageInBaseInfo('<%=storageIn.getStorageInId()%>')">基本信息</a>&nbsp;
            <a href="javascript:storageDetail('<%=storageIn.getStorageInId()%>')">样品明细</a>&nbsp;
            <%if(AppConstant.BILL_STATE_SUBMITED == storageIn.getState()){%>
            <a id="deleteA" href="javascript:deleteRecord('<%=storageIn.getStorageInId()%>')">删除</a>
            <%}%>
		  </tr>
          <%}%>
          <tr bgcolor="#ffffff" onmouseover="this.style.backgroundColor='#bbdffb';" onmouseout="this.style.backgroundColor='#ffffff'">
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td align="center" class="td5px"><a href="javascript:storageInBaseInfo('')">新增</a></td>
		  </tr>
	</table>
	<table><tr><td><%=request.getAttribute("pageURL")%></td></tr></table>
  </center>
  <%out.print(PermissionManager.getInstance().checkSubPermission("3002",request));%>
  ${message}
</body>
</html>
